package main

import (
	"fmt"
)

type Animal1 interface {
	sleep()
	getColor() string
	getType() string
}

type Cat1 struct {
	color string
}

//
//func (this *Cat1) Sleep() {
//	panic("implement me")
//}
//
//func (this *Cat1) GetColor() string {
//	panic("implement me")
//}
//
//func (this *Cat1) GetType() string {
//	panic("implement me")
//}

func (this *Cat1) sleep() {
	fmt.Println("cat is sleep..")
}
func (this *Cat1) getColor() string {
	return this.color
}

func (this *Cat1) getType() string {
	return "cat .."
}

type Dog1 struct {
	color string
}

func (this *Dog1) sleep() {
	fmt.Println("dog is sleep..")
}
func (this *Dog1) getColor() string {
	return this.color
}

func (this *Dog1) getType() string {
	return "dog"

}

func show(animal1 Animal1) {
	animal1.sleep()
	fmt.Println("color = ", animal1.getColor())
	fmt.Println("color = ", animal1.getType())
}

//
func main() {
	var animal Animal1
	animal = &Cat1{"color"}
	animal.sleep()

	animal = &Dog1{"yello"}
	animal.sleep()

	cat1 := Cat1{"green"}
	dog1 := Dog1{"yello"}
	show(&cat1)
	show(&dog1)
}
